<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>My Project: cGround类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>类列表</span></a></li>
      <li><a href="classes.html"><span>类索引</span></a></li>
      <li><a href="hierarchy.html"><span>类继承关系</span></a></li>
      <li><a href="functions.html"><span>类成员</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>类</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>变量</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pro-methods">Protected 成员函数</a>  </div>
  <div class="headertitle">
<div class="title">cGround类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>基础地板，用于当参照物。 可以运行在固定管道或SHADER；  
 <a href="classc_ground.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="c_ground_8h_source.html">cGround.h</a>&gt;</code></p>

<p><a href="classc_ground-members.html">所有成员列表.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:acd40d9fcd7b0bba9a1af55e129496974"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classc_ground.html#acd40d9fcd7b0bba9a1af55e129496974">cGround</a> (IDirect3DDevice9 *pDevice, const <a class="el" href="struct_terrain.html">Terrain</a> &amp;t)</td></tr>
<tr class="memitem:ac9e3c4a3ba0e69ea3c30d2b1c1af3775"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classc_ground.html#ac9e3c4a3ba0e69ea3c30d2b1c1af3775">init_ground</a> (D3DXVECTOR3 Center=Zero)</td></tr>
<tr class="memdesc:ac9e3c4a3ba0e69ea3c30d2b1c1af3775"><td class="mdescLeft">&#160;</td><td class="mdescRight">用的COLOR_FVF创建顶点缓冲。  <a href="#ac9e3c4a3ba0e69ea3c30d2b1c1af3775"></a><br/></td></tr>
<tr class="memitem:a9b3dcd1497270dec6e15cb62225d70d1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classc_ground.html#a9b3dcd1497270dec6e15cb62225d70d1">draw_ground</a> (int i)</td></tr>
<tr class="memdesc:a9b3dcd1497270dec6e15cb62225d70d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">渲染网格。  <a href="#a9b3dcd1497270dec6e15cb62225d70d1"></a><br/></td></tr>
<tr class="memitem:a91ae278ddc8a49efe2fc8895557e2d67"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classc_ground.html#a91ae278ddc8a49efe2fc8895557e2d67">draw_ground</a> (<a class="el" href="classc_vertex_decl.html">cVertexDecl</a> *pVertexDecl)</td></tr>
<tr class="memdesc:a91ae278ddc8a49efe2fc8895557e2d67"><td class="mdescLeft">&#160;</td><td class="mdescRight">渲染网格。  <a href="#a91ae278ddc8a49efe2fc8895557e2d67"></a><br/></td></tr>
<tr class="memitem:adbb9343a4b2e12e9ab0c6f61f41e3367"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adbb9343a4b2e12e9ab0c6f61f41e3367"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classc_ground.html#adbb9343a4b2e12e9ab0c6f61f41e3367">init_color_ground</a> (D3DXVECTOR3 Center=Zero, D3DXCOLOR Color1=GRAY, D3DXCOLOR Color2=BLACK)</td></tr>
<tr class="memdesc:adbb9343a4b2e12e9ab0c6f61f41e3367"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建顶点格式有，颜色地形。 <br/></td></tr>
<tr class="memitem:abc14d0f94f916dfecff6c089ee40d1c5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abc14d0f94f916dfecff6c089ee40d1c5"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classc_ground.html#abc14d0f94f916dfecff6c089ee40d1c5">init_light_ground</a> (D3DXVECTOR3 Center=Zero)</td></tr>
<tr class="memdesc:abc14d0f94f916dfecff6c089ee40d1c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建顶点格式有，法线地形。 <br/></td></tr>
<tr class="memitem:a8bfbe85e12fa0a7fe4d17bb4db41a644"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classc_ground.html#a8bfbe85e12fa0a7fe4d17bb4db41a644">init_tex_ground</a> (D3DXVECTOR3 Center=Zero, float Scale=1.0f)</td></tr>
<tr class="memdesc:a8bfbe85e12fa0a7fe4d17bb4db41a644"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建顶点格式有，法线，纹理地形。 纹理坐标在[0,+infinite]。  <a href="#a8bfbe85e12fa0a7fe4d17bb4db41a644"></a><br/></td></tr>
<tr class="memitem:a8fbe7e39d57f075f82c347ffc92de732"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8fbe7e39d57f075f82c347ffc92de732"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classc_ground.html#a8fbe7e39d57f075f82c347ffc92de732">init_tex_groundV1</a> (D3DXVECTOR3 Center=Zero)</td></tr>
<tr class="memdesc:a8fbe7e39d57f075f82c347ffc92de732"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建顶点格式有，法线，纹理地形。 纹理坐标控制在[0,1]。 <br/></td></tr>
<tr class="memitem:a3542ae5dc722502d41c8622be404f19b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classc_ground.html#a3542ae5dc722502d41c8622be404f19b">init_light_tex_ground_mesh</a> (<a class="el" href="classc_vertex_decl.html">cVertexDecl</a> *pVertexDecl, <a class="el" href="classc_height_map.html">cHeightMap</a> *pHeightMap, D3DXVECTOR3 Center=Zero, bool bOptimize=true)</td></tr>
<tr class="memdesc:a3542ae5dc722502d41c8622be404f19b"><td class="mdescLeft">&#160;</td><td class="mdescRight">生成地形网格。  <a href="#a3542ae5dc722502d41c8622be404f19b"></a><br/></td></tr>
<tr class="memitem:a4a03bf1094d7dc6dd16b236c1a8e1d13"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4a03bf1094d7dc6dd16b236c1a8e1d13"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classc_ground.html#a4a03bf1094d7dc6dd16b236c1a8e1d13">draw_light_tex_mesh_Ground</a> ()</td></tr>
<tr class="memdesc:a4a03bf1094d7dc6dd16b236c1a8e1d13"><td class="mdescLeft">&#160;</td><td class="mdescRight">渲染网格，仅一行代码：_pMesh-&gt;DrawSubset(0); <br/></td></tr>
<tr class="memitem:aa2b0848f0b8222a09a4f6a69cc0ad94d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classc_ground.html#aa2b0848f0b8222a09a4f6a69cc0ad94d">init_light_tex_ground_sub_mesh</a> (<a class="el" href="classc_vertex_decl.html">cVertexDecl</a> *pVertexDecl, <a class="el" href="classc_height_map.html">cHeightMap</a> *pHeightMap, D3DXVECTOR3 Center=Zero)</td></tr>
<tr class="memdesc:aa2b0848f0b8222a09a4f6a69cc0ad94d"><td class="mdescLeft">&#160;</td><td class="mdescRight">生成地形。  <a href="#aa2b0848f0b8222a09a4f6a69cc0ad94d"></a><br/></td></tr>
<tr class="memitem:aaddd7dd3b174fcf7836e114ebffb916a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaddd7dd3b174fcf7836e114ebffb916a"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classc_ground.html#aaddd7dd3b174fcf7836e114ebffb916a">draw_light_tex_sub_mesh_ground</a> ()</td></tr>
<tr class="memdesc:aaddd7dd3b174fcf7836e114ebffb916a"><td class="mdescLeft">&#160;</td><td class="mdescRight">渲染地形。 内部是循环渲染子地形块。 <br/></td></tr>
<tr class="memitem:a52dd90812d5dbb10703c2dc38ff10c73"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a52dd90812d5dbb10703c2dc38ff10c73"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classc_ground.html#a52dd90812d5dbb10703c2dc38ff10c73">get_light_texGround_sub_mesh_Y</a> (<a class="el" href="classc_height_map.html">cHeightMap</a> *pHeightMap, float Row, float Col)</td></tr>
<tr class="memdesc:a52dd90812d5dbb10703c2dc38ff10c73"><td class="mdescLeft">&#160;</td><td class="mdescRight">给出位置得到所处的高度 <br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pro-methods"></a>
Protected 成员函数</h2></td></tr>
<tr class="memitem:aafa93a358aa970dccce4ed1a07b0f99b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aafa93a358aa970dccce4ed1a07b0f99b"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classc_ground.html#aafa93a358aa970dccce4ed1a07b0f99b">sub_mesh</a> (RECT &amp;Rect, vector&lt; <a class="el" href="struct_light_texture_vertex_v1.html">LightTextureVertexV1</a> &gt; &amp;GobalVertex, <a class="el" href="classc_vertex_decl.html">cVertexDecl</a> *pVertexDecl)</td></tr>
<tr class="memdesc:aafa93a358aa970dccce4ed1a07b0f99b"><td class="mdescLeft">&#160;</td><td class="mdescRight">被init_light_tex_ground_sub_mesh（）内部调用。 <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>详细描述</h2>
<div class="textblock"><p>基础地板，用于当参照物。 可以运行在固定管道或SHADER； </p>
</div><hr/><h2>构造及析构函数说明</h2>
<a class="anchor" id="acd40d9fcd7b0bba9a1af55e129496974"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">cGround::cGround </td>
          <td>(</td>
          <td class="paramtype">IDirect3DDevice9 *&#160;</td>
          <td class="paramname"><em>pDevice</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="struct_terrain.html">Terrain</a> &amp;&#160;</td>
          <td class="paramname"><em>t</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section remark"><dt>备注:</dt><dd>要确保Terrain中的单元大小是2的倍数。 </dd></dl>
<dl class="params"><dt>参数:</dt><dd>
  <table class="params">
    <tr><td class="paramname">t,:</td><td>地形属性结构体，存放地形的相关数据。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>成员函数说明</h2>
<a class="anchor" id="a9b3dcd1497270dec6e15cb62225d70d1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cGround::draw_ground </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>渲染网格。 </p>
<dl class="params"><dt>参数:</dt><dd>
  <table class="params">
    <tr><td class="paramname">i,:</td><td>0默认线框输出，1可以输出点阵，2可以SOLID输出; </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a91ae278ddc8a49efe2fc8895557e2d67"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cGround::draw_ground </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classc_vertex_decl.html">cVertexDecl</a> *&#160;</td>
          <td class="paramname"><em>pVertexDecl</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>渲染网格。 </p>
<dl class="section remark"><dt>备注:</dt><dd>通用渲染办法。 针对init_ground();pVertexDecl创建时要使用COLOR_FVF。 如果传入的是LIGHT_TEXTURE_FVF的话会渲染错误，线路紊乱状。 </dd></dl>
<dl class="params"><dt>参数:</dt><dd>
  <table class="params">
    <tr><td class="paramname">pVertexDecl,:</td><td>顶点格式类。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ac9e3c4a3ba0e69ea3c30d2b1c1af3775"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cGround::init_ground </td>
          <td>(</td>
          <td class="paramtype">D3DXVECTOR3&#160;</td>
          <td class="paramname"><em>Center</em> = <code>Zero</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>用的COLOR_FVF创建顶点缓冲。 </p>
<dl class="params"><dt>参数:</dt><dd>
  <table class="params">
    <tr><td class="paramname">Center,:</td><td>地形的原点,从而可以改变地形的位置。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a3542ae5dc722502d41c8622be404f19b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cGround::init_light_tex_ground_mesh </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classc_vertex_decl.html">cVertexDecl</a> *&#160;</td>
          <td class="paramname"><em>pVertexDecl</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classc_height_map.html">cHeightMap</a> *&#160;</td>
          <td class="paramname"><em>pHeightMap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">D3DXVECTOR3&#160;</td>
          <td class="paramname"><em>Center</em> = <code>Zero</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>bOptimize</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>生成地形网格。 </p>
<dl class="params"><dt>参数:</dt><dd>
  <table class="params">
    <tr><td class="paramname">pVertexDecl,:</td><td>必须是LIGHT_TEXTURE_FVF创建的。 </td></tr>
    <tr><td class="paramname">pHeightMap,:</td><td>外部高度图。 </td></tr>
    <tr><td class="paramname">Center,:</td><td>网格的原点，用以调整位置。 </td></tr>
    <tr><td class="paramname">bOptimize,:</td><td>是否优化网格顶点数据; </td></tr>
  </table>
  </dd>
</dl>
<dl class="section remark"><dt>备注:</dt><dd>内部创建整块网格存放地形数据。 UV【0,1】 </dd></dl>

</div>
</div>
<a class="anchor" id="aa2b0848f0b8222a09a4f6a69cc0ad94d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cGround::init_light_tex_ground_sub_mesh </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classc_vertex_decl.html">cVertexDecl</a> *&#160;</td>
          <td class="paramname"><em>pVertexDecl</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classc_height_map.html">cHeightMap</a> *&#160;</td>
          <td class="paramname"><em>pHeightMap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">D3DXVECTOR3&#160;</td>
          <td class="paramname"><em>Center</em> = <code>Zero</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>生成地形。 </p>
<dl class="params"><dt>参数:</dt><dd>
  <table class="params">
    <tr><td class="paramname">pVertexDecl,:</td><td>必须是LIGHT_TEXTURE_FVF创建的。 </td></tr>
    <tr><td class="paramname">pHeightMap,:</td><td>外部高度图。 </td></tr>
    <tr><td class="paramname">Center,:</td><td>网格的原点，用以调整位置。 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section remark"><dt>备注:</dt><dd>内部创建整块网格存放地形数据，整块网格分解成若干子网格，整块网格被释放。 </dd></dl>

</div>
</div>
<a class="anchor" id="a8bfbe85e12fa0a7fe4d17bb4db41a644"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cGround::init_tex_ground </td>
          <td>(</td>
          <td class="paramtype">D3DXVECTOR3&#160;</td>
          <td class="paramname"><em>Center</em> = <code>Zero</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>Scale</em> = <code>1.0f</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>创建顶点格式有，法线，纹理地形。 纹理坐标在[0,+infinite]。 </p>
<dl class="params"><dt>参数:</dt><dd>
  <table class="params">
    <tr><td class="paramname">Scale,:</td><td>缩放地图的UV值，这样调节重复次数。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>E:/!代码工厂/3D引擎/<a class="el" href="c_ground_8h_source.html">cGround.h</a></li>
<li>E:/!代码工厂/3D引擎/cGround.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2012年 五月 27日 星期日 22:27:19 , 为 My Project使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1
</small></address>
</body>
</html>
